﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using PublicClass;

namespace S.RBAC.Domain.Model
{
    /// <summary>
    /// 部门表
    /// </summary>
    [Table("Department")]
    public class Department : AuditFields
    {
        /// <summary>
        /// 主键自增
        /// </summary>
        [Key]
        public int DepartId { get; set; }

        /// <summary>
        /// 父ID
        /// </summary>
        public int PId { get; set; }

        /// <summary>
        /// 上级部门
        /// </summary>
        [MaxLength(50)]
        public string? PDepartment { get; set; }

        /// <summary>
        /// 部门编号
        /// </summary>
        [MaxLength(50)]
        public string? DepartCode { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        [MaxLength(30)]
        public string? DepartName { get; set; }

        /// <summary>
        /// 部门状态
        /// </summary>
        public bool DepartState { get; set; }

        /// <summary>
        /// 部门类型
        /// </summary>
        public int DepartTypeId { get; set; }

        /// <summary>
        /// 部门级别
        /// </summary>
        public int DepartRank { get; set; }

        /// <summary>
        /// 部门区域所在地
        /// </summary>
        [StringLength(300)]
        public string? DepartLocation { get; set; }

        /// <summary>
        /// 负责人
        /// </summary>
        public int StaffId { get; set; }
    }
}
